<?php
class SPDO
{
	static private $instancePDO;

	public static function pdo()
	{
		if(!self::$instancePDO)
		{
			try
			{
				self::$instancePDO = new PDO('mysql:host=juliendonuts.no-ip.org; dbname=domotiqueFoyer', 'projetTER', 'terdomo');
				self::$instancePDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
			}
			catch (PDOException $e)
			{
				die($e->getMessage());
			}
		}

		return self::$instancePDO;
	}
}
?>
